package com.gitee.cheungming.goods.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 库存变更流水表
 * </p>
 *
 * @author Zhang Ming
 * @since 2025-10-28
 */
@Getter
@Setter
@TableName("stock_log")
public class StockLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 商品
     */
    @TableField("goods_id")
    private Long goodsId;

    /**
     * 订单
     */
    @TableField("order_id")
    private Long orderId;

    /**
     * 变更数量,正数为增加，负数为扣减
     */
    @TableField("change_count")
    private Integer changeCount;

    /**
     * 变更类型：1-预扣 2-实际扣减 3-释放 4-入库
     */
    @TableField("change_type")
    private Byte changeType;

    /**
     * 变更前库存
     */
    @TableField("before_count")
    private Integer beforeCount;

    /**
     *  变更后库存
     */
    @TableField("after_count")
    private Integer afterCount;
}
